9f2e8e
@@ -222,7 +222,7 @@
public RelOptHiveTable copy(RelDataType newRowType) {
   // Given a key this method returns true if all of the columns in the key are not nullable
   public boolean isNonNullableKey(ImmutableBitSet columns) {
     for (ImmutableBitSet key : nonNullablekeys) {
-      if (key.contains(columns)) {
+      if (columns.contains(key)) {
         return true;
       }
     }
